package com.cleaningcloud.erp.api;


import com.cleaningcloud.erp.api.domain.ErpCustomer;
import com.cleaningcloud.erp.api.factory.RemoteCustomerFallbackFactory;
import com.cleaningcloud.common.core.constant.SecurityConstants;
import com.cleaningcloud.common.core.constant.ServiceNameConstants;
import com.cleaningcloud.common.core.domain.R;
import com.cleaningcloud.erp.api.model.LoginCustomer;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @Author Shaw
 * @Description 客户服务
 * @date: 2025-03-31 17:13
 * @param: //TODO
 */
@FeignClient(contextId = "remoteCustomerService", value = ServiceNameConstants.ERP_SERVICE, fallbackFactory = RemoteCustomerFallbackFactory.class)
public interface RemoteCustomerService {

    /**
     * @Author Shaw
     * @Description 根据用户名及密码获取客户信息
     * @date: 2025-03-31 17:13
     * @param: //TODO
     */
    @GetMapping("/mall/info/{userName}")
    R<LoginCustomer> getCustomerInfo(@PathVariable("userName") String userName, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * @Author Shaw
     * @Description 注册客户信息
     * @date: 2025-04-01 16:10
     * @param: //TODO
     */
    @PostMapping("/mall/register")
    R<Boolean> registerCustomerInfo(@RequestBody ErpCustomer erpCustomer, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
